package org.zw.android.framework.http;


/**
 * Http Response wrapper
 * 
 * @author zhouwei
 *
 */
public abstract class HttpWrapper extends BaseFilter implements FilterResponse {
	
	@Override
	public final boolean doFilter(HttpRequest request, ResponseBean bean,HttpUIHandler uiHandler) {
		
		attachObject(request,bean);
		
		// parser
		wrapper(bean != null ? bean.getResponse(): null);
		
		return true;
	}
	
	/**
	 * parser result
	 * @param result : if is null, failed
	 * @return
	 */
	public abstract Object wrapper(String result) ;
	
	/**
	 * error
	 * @param result
	 */
	public abstract void onError(String result) ;
}
